package scala

/**
 * @author 黄海峰 2021/4/19 15:55
 *   */
package object fruits {

  val planted = List(Apple, Plum, Banana)

  def showFruit(fruit: Fruit): Unit = {
    println(s"${fruit.name}s are ${fruit.color}")
  }
}


case class Fruit(name: String, color: String)

object Apple extends Fruit("Apple", "green")

object Plum extends Fruit("Plum", "blue")

object Banana extends Fruit("Banana", "yellow")